package com.smdk.dsminio;

;
import com.smdk.dsminio.service.FileStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @author 神秘的凯
 * @version 1.0
 * @className StorageServiceApplication
 * @date 2020/10/14/014 19:15
 * @Description 描述
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableDiscoveryClient
@EnableFeignClients
@EnableEurekaClient
public class StorageServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(StorageServerApplication.class, args);
    }
    @Bean
    CommandLineRunner init(final FileStorageService fileStorageService) {
        return new CommandLineRunner() {
            @Override
            public void run(String... args){
                fileStorageService.init();
            }
        };
    }

}
